import axios  from 'axios';

const registerSuccess =() =>({
    Type:"REGISTER_SUCCESS",
})
export const RegisterSubmit =(data) => {
    return(dispatch) => {
        const value = JSON.stringify(data);
        let headers ={"Content-Type": "application/json; charset=utf-8"};
        axios.post('/api/register',value,headers).then((res)=>{
            console.log(res)
            dispatch(registerSuccess())
        }).catch(()=>{
            console.log('接口请求失败请重试！！')
        })
    } 
}

